<!--
* description: 权益使用记录
* author: chenjingwen
* createdDate:2021-1-25
-->
<template>
  <section class="editAreaAudit">
   <el-dialog
    v-dialogDrag
    :visible="popupsVisible"
    width="50%"
    :append-to-body="true"
    :close-on-click-modal="false"
    @close="closeEdit"
  >
     
      <dialogHeader
        slot="title"
        :title="titleName"
        :style-type="$store.state.app.dialogType"
      />

    <div class="filter-container filter-params">
        <el-row ref="vailComponentList" :gutter="26">
          <component
            :is="comp.component"
            v-for="comp in tableComponents0.filter(o => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds || ''"
            :code="formField[comp.codeField]"
            :disabled="true"
            :is-require="comp.isRequire"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :options="comp.options"
            :o-fields="comp.oFields"
            @changeCode="getComponentCode"
          />
        </el-row>
      </div>

  
      <div class="filter-container filter-title">维修项目</div>
  
          <one-table-template
            ref="multipleTable"
            :dynamic-table-cols="tableCols"
            :dynamic-api-config="apiConfig"
            :dynamic-form-fields="formField"
            :dynamic-is-show-select="false"
            :dynamic-is-show-more-btn="true"
            :dynamic-table-defult-height="300"
            
          />
       
    </el-dialog>
  </section>
</template>

<script>
import { oneTableWithViewTemplateMixins } from '@/components/mixins/oneTableWithViewTemplateMixins'
import { formMixins } from '@/components/mixins/formMixins'
import OneTableTemplate from '@/components/templates/oneTable'
import api from '@/api/subsidyManage'
// import inEdit from './inEdit.vue'

export default {
  components: {
    OneTableTemplate,
    // inEdit,
    dialogHeader: () => import('@/components/dialogHeader')
  },

  // 组件混入对象
  mixins: [oneTableWithViewTemplateMixins, formMixins],
  props: {
   
    dataForForm: {
      type: Object,
      default: () => {}
    },
    isDialogVisible: {
      type: Boolean,
      default: false
    }
  },

  data() {
    const viewPageCode = 'areaAudit-edit'

    return {
    titleName: "使用记录",
      inEditPopupsState: '',
      inEditRowData: {},
      inEditPopupsVisible: false,
      apiConfig: api.queryLog,
      // 动态组件-按钮

      // 动态组件-查询条件
       
tableComponents0:
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path] &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
          .tableComponents &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
          .tableComponents.length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
            .tableComponents
          : [
            {
              compKey: 'compKey6',
              labelName: '车牌号:',
              codeField: 'invoiceNo',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              
              isMust: true
            },
            {
              compKey: 'compKey7',
              labelName: 'VIN码:',
              codeField: 'invoiceDate',
               component: () => import('@/components/org/commonInput'),
              type: 'datePicker',
              
              isMust: true
            },
            {
              compKey: 'compKey8',
              labelName: '车主姓名:',
              codeField: 'vin',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              isMust: true
            },
         
      
          ],
  
     
    tableCols: [
        
        {
          prop: "carSeriesCn",
          label: "工单号",
          align: "center",
        },
        {
          prop: "carConfigCn",
          label: "门店编码",
          align: "center",
        },
        {
          prop: "optionalPagName",
          label: "门店名称",
          align: "center",
        },
        {
          prop: "carColorName",
          label: "到店时间",
          align: "center",
        },
         {
          prop: "carColorName",
          label: "交车时间",
          align: "center",
        },
         {
          prop: "carColorName",
          label: "送修人",
          align: "center",
        },
         {
          prop: "carColorName",
          label: "送修电话",
          align: "center",
        },
           {
          prop: "carColorName",
          label: "服务顾问",
          align: "center",
        },
             {
          prop: "carColorName",
          label: "行驶里程",
          align: "center",
        },
      ],
 
      // 标题
      textMap: {
        edit: '区域审核'
      },

      // 表单数据（无需赋值，由混入对象赋值）
      formField: this.$utils.getFormField(this, {
      }, this.$ConfigCache.CacheConfig.cacheData[viewPageCode])
    }
  },
  created() {
    this.formField = this.dataForForm
  },
  methods: {
    // 关闭弹窗
    closeEdit() {
       this.$emit("update:popupsVisible",this.popupsVisible= false);
    },

    // 审核通过
    inEdit() {
      this.queryTable(1)
      this.inEditPopupsState = '审核通过'
      this.inEditPopupsVisible = true
    },

    // 审核驳回
    reject() {
      this.queryTable(1)
      this.inEditPopupsState = '审核驳回'
      this.inEditPopupsVisible = true
    },
    // 关闭审核/驳回弹窗
    closeInEdit() {
      this.inEditPopupsVisible = false
      this.closeEdit()
    },

    queryTableon() {
      this.queryTable(1)
      this.inEditPopupsVisible = false
    }
  }

}
</script>

<style lang="scss" scoped>
  .filter-title{
    font-size: 18px;
    font-weight: bolder;
      position: relative;
  }
  .filter-container.filter-title::before{
    border-left: 4px solid #0075FF;
    padding-right: 10px;
    height: 20px;
    left: 0px;
    top: 4px;
  }
  .prompt{
    color: #e70020;
    font-size: 13px;
    height: 15px;
    line-height:15px;
  }
  /deep/.el-dialog__body{
    margin-top: 30px;
    height: 450px;
  }
  /deep/.filter-params .el-col {
    margin-bottom: 15px;
  }

.btn {
  z-index: 999999;
  position: absolute;
  top: 0;
  right: 2.5%;
}
</style>
